package org.serverct.finalfight;

import org.bukkit.plugin.java.JavaPlugin;
import org.serverct.finalfight.game.GameManager;
import org.serverct.finalfight.game.listener.GameListener;
import org.serverct.finalfight.internal.info.BossBarHandler;
import org.serverct.finalfight.internal.info.ScoreBoardHandler;
import org.serverct.finalfight.stat.StatManager;
import org.serverct.finalfight.util.CustomSettings;

public class FinalFight extends JavaPlugin {
    public static FinalFight plugin;

    @Override
    public void onEnable() {
        plugin = this;
        CustomSettings.initialize();
        GameManager.initialize();
        StatManager.initialize();
        ScoreBoardHandler.initialize();
        GameListener.initialize();
        this.getCommand("finalfight").setExecutor(new Commands());
        new PapiHook().register();
    }

    @Override
    public void onDisable() {
        for (String id : GameManager.arenas.keySet()) {
            GameManager.forceStop(id);
        }
        BossBarHandler.removeAll();
    }
}
